<!--
/**
* Author: gaohui
* Date: 2023-02-28 14:51
* Desc: LinkBtn 跳转路径按钮
*/
-->

<template>
  <div>
    <el-button type="primary" size="large" @click.stop="handleClick"
      >{{ getText }} <el-icon class="el-icon--right"><ArrowRightBold /></el-icon
    ></el-button>
  </div>
</template>

<script name="LinkBtn" lang="ts" setup>
import { computed } from "vue";
import { useRouter } from "vue-router";
import { ArrowRightBold } from "@element-plus/icons-vue";
const props = defineProps({
  btnText: {
    type: String,
    default: "",
  },
  link: {
    type: String,
    default: "",
  },
});

const getText = computed(() => {
  return props.btnText || "-";
});

const router = useRouter();
const handleClick = () => {
  router.push({
    path: props?.link || "/index",
  });
};
</script>
<style lang="scss" scoped></style>
